const express=require("express");
const cors=require("cors");
const server=express();



server.use(cors());
// server.all("*", (request, response, next) => {
//     response.setHeader("Content-Type", "application/json;charset=utf-8");
//     response.setHeader("Access-Control-Allow-Origin", "*");
//     next();
// })
server.use(express.static("./public"));
server.use(express.static("../src"));
server.use(express.urlencoded({extended:false}));
server.use(express.json());

server.use("/account", require("./routers/account"));
server.use("/cart", require("./routers/carts"));
server.use("/goods", require("./routers/goods"));

server.listen(8080,()=>{
    console.log("服务器启动成功");
})